home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 2992 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.4 KB  |  44 lines

  1. Path: news.lpr.carel.fi!usenet
  2. From: Ari Lukumies <aril@cmt.lpr.mail.carel.fi>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Printing to LPT1 Printer from within program
  5. Date: Thu, 25 Jan 1996 13:45:39 +0200
  6. Organization: Carelcomp Forest
  7. Message-ID: <31076D63.289D@cmt.lpr.mail.carel.fi>
  8. References: <4e5ee9$m28_001@pr.mcs.net>
  9. NNTP-Posting-Host: renoir.cclahti.carel.fi
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0b6a (WinNT; I)
  14.  
  15. Michael D. Perry wrote:
  16. > I have just started taking a C programming class and am using Borland
  17. > C++ v4.0 at home.  Both my teacher and I are stumped as to how to
  18. > print to a LPT (Line Printer) device from within the program.
  19. > I have read the FAQ and there are some references to this but not
  20. > enough that I can quite figure it out.  As near as I can figure you
  21. > can use iostreams or fprintf() with the later appearing to be the
  22. > simpler of the two.  With that, from what I have seen, one uses a
  23. > filename of stdprn but I get an error message when compiling.  My
  24. > guess is that there is a header file or a definition/declaration
  25. > statement that needs to be referenced.
  26. > [rest snipped]
  27.  
  28. Have you tried:
  29.  
  30.     #include    <stdio.h>
  31.  
  32.     int    main(int argc, char **argv)
  33.     {
  34.         while (argc--)
  35.             fprintf(stderr, "%s\n", *argv++);
  36.     }
  37.  
  38. Later,
  39. AriL
  40. -- 
  41. All my opinions are mine and mine alone.
  42.